package com.eaoa.query.pub;

import java.util.List;

import com.eaoa.base.EABaseQuery;
import com.eaoa.vo.pub.PubAddress;

public class PubAddressQuery extends EABaseQuery{

	public PubAddressQuery() {
		super(PubAddress.class);
	}
	
	public void setAddressno(Long val) {
		setEQCondition("addressno", val);
	}
	
	public void setAdtype(String adtype){
		setEQCondition("adtype",adtype);
	}
	
	public void setAdname(String adname){
		setLIKECondition("adname",adname);
	}

	public void setAdno(String adno){
		setEQCondition("addressno", adno);
	}
	
	public void setNOEQAdno(String adno) {
		setNOEQCondition("addressno", adno);
	}

	public void setAdcode(String adcode){
//		setEQCondition("adcode", adcode);
		this.setLIKECondition("adcode", adcode);
	}
	
	public void setAdnameen(String adnameen){
		setLIKECondition("adnameen",adnameen);
	}
	
	public void setEQAdnamecn(String adnamecn) {
		setEQCondition("adnamecn", adnamecn);
	}
	
	public void setIslock(String islock){
		setLIKECondition("islock",islock);
	}
	
	public void setASCOrder() {
		setASCOrder("adcode");
	}
	
	public void setProvince(String province){
		setLIKECondition("province",province);
	}
	
	public void setNOTLIKEAdnamecn(String adnamecn) {
		setNOTLIKECondition("adnamecn", adnamecn);
	}
	
	public void setINAdnamecn(String[] adnamecn) {
		setINCondition("adnamecn", adnamecn);
	}
	
	public void setCountry(String country){
		setLIKECondition("country",country);
	}
	
	public void setLinkman(String linkman){
		setLIKECondition("linkman",linkman);
	}
	
	public void setCity(String city){
		setLIKECondition("city",city);
	}
	
	public void setCreatorname(String creatorname){
		setLIKECondition("creatorname",creatorname);
	}
	
	public void setAdnamecnNotNull(){		
		setISNOTNULLCondition("adnamecn");
	}
	
	public void setOrderBY(String val){		
		this.setASCOrder(val);
	}
	
	
	public static PubAddress loadByNo(Long addressno) {
		PubAddressQuery query = new PubAddressQuery();
		query.setAddressno(addressno);
		List results = query.getResults();

		if (results.size() == 1)
			return (PubAddress) results.get(0);

		return null;
	}
	
}